<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = new Array();//利用new创建数组

        //利用数组字面量创建数组
        var arr = [];//创建一个空的数组
        var arr1 = [1, 2, 'pink', true];//任意类型

        console.log(arr1);//(4) [1, 2, "pink", true]
        console.log(arr1[0]);//1
        console.log(arr1[4]);//undefined
        //arr1.length 数组长度
        for (var i = 0; i < arr1.length; i++) {
            console.log(arr1[i]);
        }

    </script>
</head>

<body>

</body>

</html>